// import { Component } from '@angular/core';  
// import * as L from 'leaflet';  
  
// declare var require: any; // 在 TypeScript 中使用 require  
  
// @Component({  
//   selector: 'app-root',  
//   templateUrl: './app.component.html',  
//   styleUrls: ['./app.component.css']  
// })  
// export class AppComponent {  
//   title = 'my-app';  
//   ngOnInit() {  
//     let DefaultIcon = L.icon({  
//       iconUrl: require('./assets/marker-icon-2x.png'),  
//       iconRetinaUrl: require('./assets/marker-icon.png'),  
//       shadowUrl: require('./assets/marker-shadow.png'),  
//       iconSize: [25, 41],  
//       iconAnchor: [12, 41],  
//       popupAnchor: [1, -34],  
//       tooltipAnchor: [16, -28],  
//       shadowSize: [41, 41]  
//     });  
//     L.Marker.prototype.options.icon = DefaultIcon;  
//     // 初始化地图等其他代码...  
//   }  
// }
declare var require;
 
let DefaultIcon = L.icon({
    iconUrl: require('leaflet/dist/images/marker-icon-2x.png'),
    iconRetinaUrl: require('leaflet/dist/images/marker-icon.png'),
    shadowUrl: require('leaflet/dist/images/marker-shadow.png'),
    iconSize: [25, 41],
    iconAnchor: [12, 41],
    popupAnchor: [1, -34],
    tooltipAnchor: [16, -28],
    shadowSize: [41, 41]
});
L.Marker.prototype.options.icon = DefaultIcon;